package com.jiazhong.mingxing.boot.boot07.test;

import com.jiazhong.mingxing.boot.boot07.bean.User;
import com.jiazhong.mingxing.boot.boot07.config.JwtConfig;
import com.jiazhong.mingxing.boot.boot07.service.UserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@Slf4j
@SpringBootTest
public class App {
    @Resource
    private UserService userService;

    @Test
    public void a() {
        User user = new User();
        user.setId("10001");
        user.setUsername("熊小熊");
        user.setPassword("123456");
        String token = JwtConfig.getJwtToken(user);
        log.info("token:{}", token);
    }

    // 登陆操作
    @Test
    public void b() {
        User user = new User();
        user.setUsername("沈坤");
        user.setPassword("123456");
        //String result = userService.login(user);
        //log.info("result:{}", result);
    }

    @Test
    public void c() {
        //boolean b = userService.isLogin("eyJ0eXAiOiJKV132323ciOiJIUzI1NiJ9.eyJzdWIiOiJkYWlseWJsdWUiLCJpYXQiOjE3NjA4NDA1ODYsImV4cCI6MTc2MDkyNjk4NiwiaWQiOiIxMDA2IiwibmFtZSI6IuayiOWdpCJ9.0SqSmFz9AC7RkZUobAJxoSyqLDh38XXwiXOL17EPh94");
        //log.info("b:{}", b);
    }

}
